#ifndef __xwt_defs_h
  #define __xwt_defs_h

// assertion macros...
#define XWT_ASSERT(_C) \
if(!(_C)) __asm int 3;

#define XWT_ASSERT_M(_C,_M) \
if(!(_C)) __asm int 3;

// define tstring
#if defined(UNICODE) || defined(_UNICODE)
 typedef std::wstring tstring;
#else
 typedef std::string tstring;
#endif

// namespace macros...
#define XWT_BEGIN_NAMESPACE(_N) \
namespace _N {
#define XWT_END_NAMESPACE(_N) \
};

#ifdef WIN32
#define XWT_DECL_EVENT_HANDLER(_N) \
virtual void On##_N

#define XWT_DECL_MESSAGE_HANDLER(_N) \
virtual LRESULT _##_N##_handler (WPARAM,LPARAM);

#define XWT_DECL_DLG_MESSAGE_HANDLER(_N) \
virtual INT_PTR _DLG_##_N##_handler (WPARAM,LPARAM);

#define XWT_IMP_MESSAGE_HANDLER(_T,_N) \
LRESULT _T::_N##_handler (WPARAM wparam, LPARAM lparam) { \
	On##_N (); \
}
#endif /* WIN32 */

XWT_BEGIN_NAMESPACE(xwt)

#ifdef WIN32
typedef HWND XWTWND;
#endif /* WIN32 */

XWT_END_NAMESPACE(xwt)

#endif /* __xwt_defs_h */
